import axios from "axios";
import { get, prefix } from "../utils/requestDecorator";
import log from '../utils/logger'

@prefix("/user")
export default class User {
  @get("/getToken")
  async getToken() {
    log.warn("获取token",1)
    const {data} = (await axios.get(
      "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx7c8148fa23a8b4ff&secret=f8cf95e2fbcbe455c841df2d70eef0ce"
    )) as any;
    log.warn("获取token",data)
    // ctx.body = {
    //   data,
    // };
    return data;
  }
}
